//
//  UIView+LCView.m
//  05- 模态视图控制器的切换
//
//  Created by 千锋 on 16/4/12.
//  Copyright (c) 2016年 千锋. All rights reserved.
//

#import "UIView+LCView.h"

@implementation UIView (LCView)



- (void)addTransitionAnimationDurection:(NSTimeInterval)durection anitionType:(LCTransitionType)type direction:(LCTransitionDirection)direction{
    //1.创建动画对象
    CATransition *trAnimation = [CATransition animation];
    //2.设置动画时间
    trAnimation.duration = durection;
    //3.设置动画类型
    NSArray *typeArray = @[@"pageCurl",@"pageUnCurl",@"rippleEffect",@"suckEffect"@"cube",@"oglFlip",@"cameraIrisHollowOpen",kCATransitionFade,kCATransitionMoveIn,kCATransitionPush,kCATransitionReveal];
    
    [trAnimation setType:typeArray[type]];
    
    //4.设置方向
    NSArray *directionArray = @[@"fromUp",@"fromDown",@"fromLeft",@"fromRight"];
    [trAnimation setSubtype:directionArray[direction]];
    //5.添加动画
    [self.window.layer addAnimation:trAnimation forKey:@"aa"];

}


@end
